package com.jch.d1;

import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

import java.util.Arrays;

public class Collect {

    public static void main(String[] args) throws Exception {

        //创建环境
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        //获取数据源
        DataStreamSource<Sourcedata> source = env.fromCollection(Arrays.asList(
//                new Sourcedata("zhangsan", 11111111111,10.0),
//                new Sourcedata("lisi", 20.0),
//                new Sourcedata("ww", 30.0)
        ));

        //获取数据源
        DataStreamSource<String> dataStreamSource = env.fromElements("12", "90", "87", "33");


        //打印
        source.print("1");
        dataStreamSource.print("2");

        //执行
        env.execute();

    }

}
